package com.wiseMen.wechat.subscribe;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import com.ibm.icu.util.Calendar;
import com.wiseMen.core.dao.EntityDao;

/**
 * 微信用户关注日志信息
 * @author 吴人龙
 */
@Service(value="SubscribeService")
public class SubscribeService {

	@Autowired
    private EntityDao entityDao;
	
	@Autowired
	private JdbcTemplate jdbcTemplate;
	
	/**
	 * 添加微信用户关注/取消关注日志信息
	 * @param openId 微信ID
	 * @param code 关注标识： 1：关注 2：取消关注 
	 */
	public void add(String openId,int code){
		SubscribeEntity entity = new SubscribeEntity();
		entity.setOpenId(openId);
		entity.setCode(code);
		entity.setOperateTime(Calendar.getInstance().getTime());
		this.entityDao.insert(entity);
	}
}
